﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using ABC.Business.Models;
using ABC.Core.Configuration;

namespace ABC.Controllers.ViewModels.My.Partners.Admin
{
    public class AddProductViewModel : BaseViewModel
    {

        public string Id { get; set; }

        public string Partner { get; set; }

        public List<SelectListItem> ListForPartner { get; set; }

        public string Type { get; set; }

        public List<SelectListItem> ListForType { get; set; }

        public bool IsArchive { get; set; }

        public string Name { get; set; }

        public string Link { get; set; }

        public string Description { get; set; }

        public AddProductViewModel()
        {
            var partnerModel = IoC.Resolve<PartnerModel>();
            ListForPartner = new List<SelectListItem>();
            ListForType = new List<SelectListItem>();
            ListForPartner =
                partnerModel.GetPartners().Select(x => new SelectListItem {Value = x.Key, Text = x.Value}).
                    ToList();
            ListForType =
                partnerModel.GetTypesOfInsurance().Select(x => new SelectListItem {Value = x.Key, Text = x.Value}).
                    ToList();
        }
    }
}
